import { onShow } from '@dcloudio/uni-app'
import useUserStore from '@/store/user'
import { toast } from '@/utils/uni-app'

export const useLoginToast = () => {
  const userStore = useUserStore()

  onShow(() => {
    if (!userStore.loginToast) return

    toast.info('请先登录')
    userStore.setLoginToast(false)
  })
}
